<template>
  <div v-if="question1.visible">
    <h3>{{ question1.text }}</h3>
    <div>
      <a-select
          v-model:value="answer1['answer']"
          placeholder="请选择"
          style="width: 300px;"
      >
        <a-select-option
            v-for="(option, index) in question1.options"
            :key="index"
            :value="option.value"
        >
          {{ option.text }}
        </a-select-option>
      </a-select>
    </div>
  </div>
</template>

<script setup>
import { defineProps} from 'vue';
import {useQuestions} from "@/utils/paper.js";
const { getQuestionById,getAnswerById} = useQuestions()
// 使用 defineProps 接收父组件传递的属性
const props = defineProps({
  questionId:{
    type:String
  }
});

const questionId=props.questionId;
const question1=getQuestionById(questionId);
const answer1=getAnswerById(questionId);
</script>

<style scoped>
</style>
